package com.wyz.common;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author wk
 * @desc 响应结果工具类
 * @date 2024/12/18 14:37
 */
@Data
@AllArgsConstructor
public class ResultResponse {
    //状态码
    private int code;
    //状态信息
    private String message;
    //响应数据
    private Object data;

    public static ResultResponse success(Object data){
        return new ResultResponse(200,"success",data);
    }

    public static ResultResponse fail(Object data){
        return new ResultResponse(500,"fail",data);
    }
    public static ResultResponse unauthorized(Object data){
        return new ResultResponse(401,"unauthorized",data);
    }
}
